package com.foreknow.demo12;

import com.foreknow.demo2.A;
import com.foreknow.demo2.Admin;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class ListDemo2 {
    public void m1(List<Admin> list){
        for (int i = 0; i < list.size(); i++) {
            Admin ii = (Admin) list.get(i);
            System.out.println(ii.getId());
            System.out.println(ii.getName());
            System.out.println(ii.getPass());
        }
    }

    public static void main(String[] args) {
       List<Admin> list = new ArrayList<>();

        Scanner input = new Scanner(System.in);
        for (int i = 0; i < 3; i++) {
            Admin admin = new Admin();
            System.out.println("请输入编号：");
            int id = input.nextInt();
            admin.setId(id);
            System.out.println("请输入姓名：");
            String name = input.next();
            admin.setName(name);
            System.out.println("请输入密码：");
            String pass = input.next();
            admin.setPass(pass);

            list.add(admin);
        }
        ListDemo2 listDemo2 = new ListDemo2();
        listDemo2.m1(list);

    }
}
